package cn.zz.camerasdk.filter;

/**
 * author: zhu on 2017/7/11 12:03
 * email: mackkill@gmail.com
 */


public class GPUImageEmbossFilter extends GPUImage3x3ConvolutionFilter {
    private float mIntensity;

    public GPUImageEmbossFilter() {
        this(1.0F);
    }

    public GPUImageEmbossFilter(float intensity) {
        this.mIntensity = intensity;
    }

    public void onInit() {
        super.onInit();
        this.setIntensity(this.mIntensity);
    }

    public void setIntensity(float intensity) {
        this.mIntensity = intensity;
        this.setConvolutionKernel(new float[]{intensity * -2.0F, -intensity, 0.0F, -intensity, 1.0F, intensity, 0.0F, intensity, intensity * 2.0F});
    }

    public float getIntensity() {
        return this.mIntensity;
    }
}

